<template>
  <!-- 文本输入框 -->
  <!-- :type="props.columnData.fieldTypeCode == 'TEXTAREA' ? 'textarea' : 'text'" -->
  <el-input
    v-if="['TEXT', 'PHONE', 'EMAIL', 'TENANT_CODE', 'TEXTAREA'].includes(props.columnData.fieldTypeCode)"
    v-model.trim="props.itemData[props.columnData.fieldCode]"
    type="text"
    :placeholder="props.columnData.placeholder || '请输入'"
    :disabled="props.columnData.disabled"
    :maxlength="props.columnData.maxLength ? props.columnData.maxLength : ''"
    @blur="handelBlur"
    @change="handelChange"
    clearable
  />
</template>

<script setup name="Vinput">
import { ref, reactive, computed } from 'vue'
import { mixinsData } from '../hooks/mixinsData'

const props = defineProps({
  columnData: {
    type: Object,
    default: () => {}
  },
  itemData: {
    type: Object,
    default: () => {}
  },
  rules: {
    type: Object,
    default: () => {}
  }
})

const { handelBlur, handelChange } = mixinsData(props.columnData, props.itemData, props.rules)
</script>
<style lang="scss"></style>
